package com.example.design.b.proxy1;

/**
 * 中国人的代理类
 * 推荐使用组合模式
 */
public class ProxyChinese extends Person {

    private final Chinese chinese;

    public ProxyChinese() {
        this.chinese = new Chinese();
    }

    @Override
    public void eat() {
        preHandle();
        chinese.eat();
        postHandle();
    }

    public void preHandle() {
        System.out.println("洗手");
    }

    public void postHandle() {
        System.out.println("泡一壶西湖龙井再去刷碗洗盘子");
    }
}
